<?php if ($this->Membership_model->is_owner($bricabox->id)): ?>
<div class="block_header">
	<div id="block_prefs_<?php echo $inst->id; ?>" style="display: none;">
		<form action="/bricabox/<?php echo $bricabox->id; ?>/save_block_prefs" method="post">
			<input type="hidden" name="id" value="<?php echo $inst->id; ?>" />
			<input type="hidden" name="block_name" value="ad_block" />
			<input type="hidden" name="name" value="ad_code" />
			<input type="hidden" name="return_to" value="/<?php echo $this->uri->uri_string(); ?>" />
			<fieldset>
				<div>
					<label for="ad_code_<?php echo $inst->id; ?>">Paste your ad code below:</label><br />
					<textarea name="value" id="ad_code_<?php echo $inst->id; ?>" rows="8" cols="25" style="width: 99%;"><?php if ($value) echo $value; ?></textarea><br />
					Note: We run our own ads every other&nbsp;pageview.
				</div>
				
				<div class="controls">
					<input type="submit" value="Save" />
					or <a href="#" onclick="return PrefPane.toggle(<?php echo $inst->id; ?>);">cancel</a>
				</div>
			</fieldset>
		</form>
	</div>
</div>
<?php endif; ?>

<?php echo $ad_code; ?>